package com.example.bootdemo.configuration;

import com.example.bootdemo.pojo.UserInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.jpa.repository.support.SimpleJpaRepository;

import javax.persistence.EntityManager;

@Configuration
public class BeansConfiguration {

    @Autowired
    private EntityManager entityManager;

    @Bean("userSpecificationRepository")
    public SimpleJpaRepository userSpecificationRepository(){

        return new SimpleJpaRepository<UserInfo,Long>(UserInfo.class,entityManager);
    }

}
